package org.budo.compress;

import java.io.File;
import java.io.InputStream;

import org.budo.support.lang.util.FileUtil;
import org.budo.support.lang.util.IoUtil;

/**
 * @author li
 */
public abstract class AbstractCompressor implements Compressor {
    /**
     * 解压缩
     */
    public void decompress(InputStream inputStream, String toFilePath) {
        File tmp = FileUtil.createTempFile("budo.compress.", ".tmp");
        IoUtil.write(inputStream, tmp);
        this.decompress(tmp, new File(toFilePath));
    }
}